package com.dayou.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.dayou.bean.RegInfo;
import com.dayou.service.IRegInfoService;
import com.dayou.common.core.controller.BaseController;
import com.dayou.common.core.page.TableDataInfo;
import com.dayou.common.core.domain.AjaxResult;
import com.dayou.common.utils.poi.ExcelUtil;
import org.springframework.web.bind.annotation.RestController;

/**
 * 外来人员注册 信息操作处理
 * 
 * @author dayou
 * @date 2020-04-29
 */
@RestController
@RequestMapping("/regInfo")
public class RegInfoController extends BaseController
{
	@Autowired
	private IRegInfoService regInfoService;

	/**
	 * 查询所有外来人员注册列表
	 */
	@PostMapping("/listAll")
	@ResponseBody
	public TableDataInfo listAll(@RequestBody RegInfo regInfo)
	{
		startPage();
		List<RegInfo> list = regInfoService.selectRegInfoList(regInfo);
		return getDataTable(list);
	}

	/**
	 * 根据id组查询外来人员注册列表
	 */
	@PostMapping("/listByIds")
	@ResponseBody
	public AjaxResult listByIds(@RequestParam String ids)
	{
		return AjaxResult.success(regInfoService.selectRegInfoByIds(ids));
	}


	
	
	/**
	 * 导出外来人员注册列表
	 */
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(RegInfo regInfo)
    {
    	List<RegInfo> list = regInfoService.selectRegInfoList(regInfo);
        ExcelUtil<RegInfo> util = new ExcelUtil<RegInfo>(RegInfo.class);
        return util.exportExcel(list, "注册人员信息");
    }
}
